package com.sftz.modules.minapp.teachActivity.module;

import java.util.Map;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

import com.sftz.modules.minapp.teachActivity.service.TeachActivityStudyViewService;
import com.sftz.modules.minapp.user.cache.RedissionUserCache;

/**
 * @author   DuKL  教学实践列表
 * @Date	 2018年12月19日
 */
@IocBean
@Filters
@At("/wx/teachActivity")
public class TeachActivityStudyModule {

	@Inject
	private TeachActivityStudyViewService teachActivityStudyViewService;

	/**
	 * @author   DuKL
	 * @Date	 2018年12月19日
	 * (effect:教学实践列表数据)
	 */
	@At
	@Ok("json")
	public Map<String, Object> courseTeachActivityInfo(@Param("courseId") final Integer courseId,
			@Param("token") final String token) {
		Integer userId = RedissionUserCache.getUserId(token);
		return teachActivityStudyViewService.courseTeachActivityInfo(courseId, userId);
	}

	@At
	@Ok("json")
	public Object teachActMessageQuery(@Param("token") final String token,
			@Param("courseStruId") final Integer courseStruId) {
		Integer userId = RedissionUserCache.getUserId(token);
		return teachActivityStudyViewService.activitSingleMessage(userId, courseStruId);
	}

}
